import base64


""" 图片文件参数 """
def image_file_format(filePath):
    with open(filePath, 'rb') as fp:
        image_base64 = base64.encodebytes(fp.read()).decode()
        return {
            "image": image_base64,
            "image_type": "BASE64",
            "face_type": "LIVE",
            "quality_control": "LOW"
        }


"""链接图片参数"""
def http_image_format(url):
    return {
        "image": url,
        "image_type": "URL",
        "face_type": "LIVE",
        "quality_control": "LOW"
    }
